<#include "header.htm"/>
<#assign preview = preview?default(false)/>

<script type="text/javascript" src="${contextPath}/dwr/interface/AjaxUtils.js?${startupTime}"></script>
<script type="text/javascript" src="${contextPath}/dwr/engine.js?${startupTime}"></script>
<script type="text/javascript">
<#include "js/bbcode_help.js"/>
<#include "js/utils.js"/>
</script>
<script type="text/javascript" src="${contextPath}/templates/${templateName}/js/post.js?${startupTime}"></script>

<script type="text/javascript">
<!--
function validatePostForm(f)
{
	<#if setType?default(true)>
	if (f.subject.value == "") {
		alert("${I18n.getMessage("PostForm.subjectEmpty")}");
		f.subject.focus();
		
		return false;
	}
	</#if>
	
	if (f.message.value.replace(/^\s*|\s*$/g, "").length == 0) {
		alert("${I18n.getMessage("PostForm.textEmpty")}");
		f.message.focus();
		
		return false;
	}

	<#if !forum?exists>
	if (f.toUsername.value == "") {
		alert("${I18n.getMessage("PrivateMessage.toUserIsEmpy")}");
		f.toUsername.focus();

		return false;
	}
	</#if>
	
	return true;
}

-->
</script>

<#assign preview = preview?exists && preview/>
<#assign isNewPost = isNewPost?exists && isNewPost/>
<#assign isEdit = isEdit?if_exists/>
<#assign isNewTopic = (!topic?exists || topic.id == -1)/>
<#assign attachmentsEnabled = attachmentsEnabled?exists && attachmentsEnabled/>

<#if !maxAttachments?exists>
	<#assign maxAttachments = 0/>
</#if>

<#assign htmlChecked = "checked=\"checked\""/>
<#assign bbChecked = ""/>
<#assign signatureChecked = "checked=\"checked\""/>
<#assign repliesChecked = "checked=\"checked\""/>
<#assign smiliesChecked = ""/>

<#if isNewPost && !preview && !post?exists>
	<#if user.isHtmlEnabled()><#assign htmlChecked = ""/></#if>
	<#if !user.isBbCodeEnabled()><#assign bbChecked = "checked=\"checked\""/></#if>
	<#if !user.isSmiliesEnabled()><#assign smiliesChecked = "checked=\"checked\""/></#if>
	<#if !user.getAttachSignatureEnabled()><#assign signatureChecked = ""/></#if>
<#elseif post?exists>
	<#if post.isHtmlEnabled()><#assign htmlChecked = ""/></#if>
	<#if !post.isBbCodeEnabled()><#assign bbChecked = "checked=\"checked\""/></#if>
	<#if !post.isSmiliesEnabled()><#assign smiliesChecked = "checked=\"checked\""/></#if>
	<#if !post.isSignatureEnabled()><#assign signatureChecked = ""/></#if>
</#if>

<#if !user.isNotifyOnMessagesEnabled()><#assign repliesChecked = ""/></#if>

<form action="${JForumContext.encodeURL("/jforum")}" method="post" enctype="multipart/form-data" name="post" id="post" onsubmit="return validatePostForm(this)">
<input type="hidden" name="action" value="${action}" />
<input type="hidden" name="module" value="${moduleName}" />
<input type="hidden" name="preview" value="0"/>
<input type="hidden" name="securityHash" value="${securityHash}" />
<#if forum?exists><input type="hidden" name="forum_id" value="${forum.id}" /></#if>
<input type="hidden" name="start" value="${start?default("")}" />
<#if isEdit><input type="hidden" name="post_id" value="${post.id}" /></#if>
<#if !isNewTopic><input type="hidden" name="topic_id" value="${topic.id}" /></#if>

<table cellspacing="0" cellpadding="10" width="100%" align="center" border="0">
	<tr>
		<td class="bodyline">
			
			<!-- Preview message -->
			<a name="preview"></a>
			<table class="forumline" width="100%" cellspacing="1" cellpadding="4" border="0" <#if !preview>style="display: none"</#if> id="previewTable">
				<tr>
					<th height="25" class="thhead">${I18n.getMessage("PostForm.preview")}</th>
				</tr>
				<tr>
					<td class="row1">
						<img src="${contextPath}/templates/${templateName}/images/icon_minipost.gif" alt="Post" />
						<span class="postdetails" id="previewSubject"> ${I18n.getMessage("PostForm.subject")}: <#if postPreview?exists>${postPreview.subject}</#if></span>
					</td>
				</tr>
				<tr>
					<td class="row1" height="100%">
						<table width="100%" border="0" cellspacing="0" cellpadding="0" style="height:100%">
							<tr>
								<td><span id="previewMessage" class="postbody"><#if postPreview?exists>${postPreview.text}</#if></span></td>
							</tr>

							<#if (user?exists && user.attachSignatureEnabled && user.signature?exists && user.signature?length > 0 && post?exists && post.isSignatureEnabled())>
								<tr>
									<td>
										<hr />
										<span class="gensmall" id="previewSignature">
											<#if previewUser?exists>
												${previewUser.signature}
											<#else>
												${user.signature}
											</#if>
										</span>
									</td>
								</tr>
							</#if>
						</table>
					</td>
				</tr>
				<tr>
					<td class="spacerow" height="1"><img src="${contextPath}/templates/${templateName}/images/spacer.gif" alt="" width="1" height="1" /></td>
				</tr>
			</table>
			<br clear="all" />

			<table cellspacing="2" cellpadding="2" width="100%" align="center" border="0">
				<tr>
					<td align="left">
						<span class="nav">
							<a class="nav" href="${JForumContext.encodeURL("/forums/list")}">${I18n.getMessage("ForumListing.forumIndex")}</a>

							<#if forum?exists>
							-&gt; <a class="nav" href="${JForumContext.encodeURL("/forums/show/${forum.id}")}">${forum.name}</a>
							</#if>
						</span>
					</td>
				</tr>
			</table>
		
			<table class="forumline" cellspacing="1" cellpadding="3" width="100%" border="0">
				<tr>
					<th class="thhead" colspan="2" height="25">
						<b>
						<#if forum?exists>
							<#if (topic?exists && topic.id > -1)>
								${I18n.getMessage("PostForm.reply")} "${topic.title}"
							<#else>
								${I18n.getMessage("PostForm.title")}
							</#if>
						<#else>
							<#if pmReply?default(false)>
								${I18n.getMessage("PrivateMessage.reply")}
							<#else>
								${I18n.getMessage("PrivateMessage.title")}
							</#if>
						</#if>
						</b>
					</th>
				</tr>

				<#if !forum?exists>
					<tr>
						<td class="row1" width="22%"><span class="gen"><b>${I18n.getMessage("PrivateMessage.user")}</b></span></td>
						<td class="row2" width="78%">
							<#if pmRecipient?exists>
								<#assign toUsername = toUsername/>
								<#assign toUserId = toUserId/>
								<#elseif preview>
								<#assign toUsername = pm.toUser.username/>
								<#assign toUserId = pm.toUser.id/>
								<#elseif quote?default("") == "true" || pmReply?default(false)>
								<#assign toUsername = pm.fromUser.username/>
								<#assign toUserId = pm.fromUser.id/>
							<#else>
								<#assign toUsername = ""/>
								<#assign toUserId = ""/>
							</#if>

							<input class="post" size="25" name="toUsername" value="${toUsername}"/>&nbsp;
							<input type="button" value="${I18n.getMessage("PrivateMessage.findUser")}" name="findUser" class="liteoption" onclick="window.open('${JForumContext.encodeURL("/pm/findUser")}','_findUser', 'height=250,resizable=yes,width=400');return false;" />
							<input type="hidden" name="toUserId" value="${toUserId}" />
						</td>
					</tr>
				</#if>

				<#if errorMessage?exists>
					<tr>
						<td colspan="2" align="center"><span class="gen"><font color="#ff0000"><b>${errorMessage}</b></font></span></td>
					</tr>
				</#if>

				<tr>
					<td class="row1" width="22%"><span class="gen"><b>${I18n.getMessage("PostForm.subject")}</b></span></td>
					<#if post?exists>
						<#assign subject = post.subject?default("")?html/>
						<#elseif pmReply?default(false)>
						<#assign subject = pm.post.subject?html/>
						<#elseif topic?exists>
						<#assign subject = I18n.getMessage("Message.replyPrefix") + topic.title?default("")?html/>
					</#if>
					<td class="row2" width="78%">
						<span class="gen">
							<input class="post" style="WIDTH: 460px" tabindex="2" maxlength="100" size="45" name="subject" value="${subject?default("")}" /> 
						</span>
					</td>
				</tr>

				<tr>
					<td class="row1" valign="top">
						<table cellspacing="0" cellpadding="1" width="100%" border="0">
							<tr>
								<td><span class="gen"><b>${I18n.getMessage("PostForm.body")}</b></span> </td>
							</tr>
							
							<tr>
								<td valign="middle" align="center">
									<br />
									<table cellspacing="0" cellpadding="5" width="100" border="0">
										<tr align="center">
											<td class="gensmall" colspan="4"><b>${I18n.getMessage("PostForm.emoticons")}</b></td>
										</tr>

										<#assign count = 0/>
										<#assign lastSmilie = ""/>
										<!--
										<tr valign="middle" align="center">
										-->
											<#list smilies as smilie>
												<#if (count < 20)>
													<#if lastSmilie == "" || lastSmilie.url != smilie.url>
														<#if count % 4 == 0>
															<tr>
														</#if>
														<td><a href="javascript:emoticon('${smilie.code}');">${smilie.url}</a></td>
														<#assign count = count + 1/>
														<#if count % 4 == 0>
															</tr>
														</#if>
														<#assign lastSmilie = smilie/>
													</#if>
												</#if>
											</#list>

											<#if !(count % 4 == 0)>
											</#if>
										<tr align="center">
											<td colspan="4">
										<script type="text/javascript">
										<!--
										function smiliePopup()
										{
											w = window.open("${JForumContext.encodeURL("/posts/listSmilies")}", "smilies", "width=300, height=300, toolbars=no, scrollbars=yes");
											w.focus();
										}
										-->
										</script>
												<span class="nav"><a href="#" onclick="smiliePopup();return false;">${I18n.getMessage("PostForm.moreSmilies")}</a></span>
											</td>
										</tr>
									</table>
								</td>
							</tr>
						</table>
					</td>

					<td class="row2" valign="top">
						<div class="gen"><!--<span class="gen">-->
							<table cellspacing="0" cellpadding="2" width="470" border="0">
								<tr valign="middle" align="center">
									<td><span class="genmed"><input class="button" onmouseover="helpline('b')" style="FONT-WEIGHT: bold; WIDTH: 30px" accesskey="b" onclick="bbstyle(0)" type="button" value=" B " name="addbbcode0" /> </span></td>
									<td><span class="genmed"><input class="button" onmouseover="helpline('i')" style="WIDTH: 30px; FONT-STYLE: italic" accesskey="i" onclick="bbstyle(2)" type="button" value=" i " name="addbbcode2" /> </span></td>
									<td><span class="genmed"><input class="button" onmouseover="helpline('u')" style="WIDTH: 30px; TEXT-DECORATION: underline" accesskey="u" onclick="bbstyle(4)" type="button" value=" u " name="addbbcode4" /> </span></td>
									<td><span class="genmed"><input class="button" onmouseover="helpline('q')" style="WIDTH: 50px" accesskey="q" onclick="bbstyle(6)" type="button" value="Quote" name="addbbcode6" /> </span></td>
									<td><span class="genmed"><input class="button" onmouseover="helpline('c')" style="WIDTH: 40px" accesskey="c" onclick="bbstyle(8)" type="button" value="Code" name="addbbcode8" /> </span></td>
									<td><span class="genmed"><input class="button" onmouseover="helpline('l')" style="WIDTH: 40px" accesskey="l" onclick="bbstyle(10)" type="button" value="List" name="addbbcode10" /> </span></td>
									<td><span class="genmed"><input class="button" onmouseover="helpline('p')" style="WIDTH: 40px" accesskey="p" onclick="bbstyle(12)" type="button" value="Img" name="addbbcode12" /> </span></td>
									<td><span class="genmed"><input class="button" onmouseover="helpline('w')" style="WIDTH: 40px" accesskey="w" onclick="bbstyle(14)" type="button" value="URL" name="addbbcode14" /> </span></td>
								</tr>
								
								<tr>
									<td colspan="8">
										<table cellspacing="0" cellpadding="0" width="100%" border="0">
											<tr>
												<td>
													<span class="genmed">&nbsp;${I18n.getMessage("PostForm.textColor")}: 
													<select onmouseover="helpline('s')" onchange="bbfontstyle('[color=' + this.form.addbbcode18.options[this.form.addbbcode18.selectedIndex].value + ']', '[/color]')" name="addbbcode18"> 
														<option class="genmed" style="COLOR: black; BACKGROUND-COLOR: #fafafa" value="#444444" selected="selected">${I18n.getMessage("PostForm.colorDefault")}</option> 
														<option class="genmed" style="COLOR: darkred; BACKGROUND-COLOR: #fafafa" value="darkred">${I18n.getMessage("PostForm.colorDarkRed")}</option> 
														<option class="genmed" style="COLOR: red; BACKGROUND-COLOR: #fafafa" value="red">${I18n.getMessage("PostForm.colorRed")}</option> 
														<option class="genmed" style="COLOR: orange; BACKGROUND-COLOR: #fafafa" value="orange">${I18n.getMessage("PostForm.colorOrange")}</option> 
														<option class="genmed" style="COLOR: brown; BACKGROUND-COLOR: #fafafa" value="brown">${I18n.getMessage("PostForm.colorBrown")}</option> 
														<option class="genmed" style="COLOR: yellow; BACKGROUND-COLOR: #fafafa" value="yellow">${I18n.getMessage("PostForm.colorYellow")}</option> 
														<option class="genmed" style="COLOR: green; BACKGROUND-COLOR: #fafafa" value="green">${I18n.getMessage("PostForm.colorGreen")}</option> 
														<option class="genmed" style="COLOR: olive; BACKGROUND-COLOR: #fafafa" value="olive">${I18n.getMessage("PostForm.colorOlive")}</option> 
														<option class="genmed" style="COLOR: cyan; BACKGROUND-COLOR: #fafafa" value="cyan">${I18n.getMessage("PostForm.colorCyan")}</option> 
														<option class="genmed" style="COLOR: blue; BACKGROUND-COLOR: #fafafa" value="blue">${I18n.getMessage("PostForm.colorBlue")}</option> 
														<option class="genmed" style="COLOR: darkblue; BACKGROUND-COLOR: #fafafa" value="darkblue">${I18n.getMessage("PostForm.colorDarkBlue")}</option> 
														<option class="genmed" style="COLOR: violet; BACKGROUND-COLOR: #fafafa" value="violet">${I18n.getMessage("PostForm.colorViolet")}</option> 
														<option class="genmed" style="COLOR: white; BACKGROUND-COLOR: #fafafa" value="white">${I18n.getMessage("PostForm.colorWhite")}</option>
														<option class="genmed" style="COLOR: black; BACKGROUND-COLOR: #fafafa" value="black">${I18n.getMessage("PostForm.colorBlack")}</option>
													</select> 

													&nbsp;${I18n.getMessage("PostForm.font")}:
													<select onmouseover="helpline('f')" onchange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]')" name="addbbcode20"> 
														<option class="genmed" value="7">${I18n.getMessage("PostForm.fontVerySmall")}</option> 
														<option class="genmed" value="9">${I18n.getMessage("PostForm.fontSmall")}</option> 
														<option class="genmed" value="12" selected="selected">${I18n.getMessage("PostForm.fontNormal")}</option> 
														<option class="genmed" value="18">${I18n.getMessage("PostForm.fontBig")}</option> 
														<option class="genmed" value="24">${I18n.getMessage("PostForm.fontGiant")}</option>
													</select> 
													</span>
												</td>
												<td nowrap="nowrap" align="right">
													<span class="gensmall"><a class="genmed" onmouseover="helpline('a')" href="javascript:bbstyle(-1)">${I18n.getMessage("PostForm.closeMarks")}</a></span>
												</td>
											</tr>
										</table>
									</td>
								</tr>

								<tr>
									<td colspan="9">
										<span class="gensmall">
										<input name="helpbox" class="helpline" style="FONT-SIZE: 10px; WIDTH: 450px" value="${I18n.getMessage("PostForm.helplineTip")}" size="45" maxlength="100" /> 
										</span>
									</td>
								</tr>
								
								<tr>
									<td colspan="9" valign="top">
										<span class="gen">
											<textarea class="post" onkeyup="storeCaret(this);" onclick="storeCaret(this);" onselect="storeCaret(this);" style="WIDTH: 450px"  tabindex="3" name="message" rows="15"  cols="35"><#if post?exists><#if quote?exists>[quote=${quoteUser}]${post.text?html}[/quote]<#else>${post.text?html}</#if></#if></textarea> 
										</span>
									</td>
								</tr>
							</table>
						</div> 
					</td>
				</tr>
				
				<tr>
					<td class="row1" valign="middle" align="center"><span class="gen"><b>${I18n.getMessage("PostForm.options")}</b></span></td>
					<td class="row2">
						<table cellspacing="0" cellpadding="1" border="0">
							<#if htmlAllowed>
								<tr>
								<td><input type="checkbox" id="disable_html" name="disable_html" ${htmlChecked} /></td>
								<td><span class="gen"><label for="disable_html">${I18n.getMessage("PostForm.disableHtml")}</label></span></td>
								</tr>
							<#else>
								<input type="hidden" name="disable_html" value="1" />
							</#if>
							<tr>
								<td><input type="checkbox" id="disable_bbcode" name="disable_bbcode" ${bbChecked} /> </td>
								<td><span class="gen"><label for="disable_bbcode">${I18n.getMessage("PostForm.disableBbCode")}</label></span></td>
							</tr>
							<tr>
								<td><input type="checkbox" id="disable_smilies" name="disable_smilies" ${smiliesChecked} /> </td>
								<td><span class="gen"><label for="disable_smilies">${I18n.getMessage("PostForm.disableSmilies")}</label></span></td>
							</tr>

							<#if user.id != 1>
								<tr>
									<td><input type="checkbox" id="attach_sig" name="attach_sig" ${signatureChecked} /> </td>
									<td><span class="gen"><label for="attach_sig">${I18n.getMessage("PostForm.appendSignature")}</label></span></td>
								</tr>

								<#if forum?exists>
								<tr>
									<td><input type="checkbox" id="notify" name="notify" ${repliesChecked} /> </td>
									<td><span class="gen"><label for="notify">${I18n.getMessage("PostForm.notifyReplies")}</label></span></td>
								</tr>
								</#if>
							</#if>

							<#if setType?default(true) && forum?exists && canCreateStickyOrAnnouncementTopics?default(false)>
							<tr>
								<td>&nbsp;</td>
								<td>
									<span class="gen">${I18n.getMessage("PostForm.setTopicAs")}:
									<input type="radio" checked="checked" value="0" id="topic_type0" name="topic_type" <#if topic?exists && topic.type == 0>checked="checked"</#if> /><label for="topic_type0">${I18n.getMessage("PostForm.setTopicAsNormal")}</label>&nbsp;&nbsp;
									<input type="radio" value="1" id="topic_type1" name="topic_type" <#if topic?exists && topic.type == 1>checked="checked"</#if> /><label for="topic_type1">${I18n.getMessage("PostForm.setTopicAsSticky")}</label>&nbsp;&nbsp;
									<input type="radio" value="2" id="topic_type2" name="topic_type" <#if topic?exists && topic.type == 2>checked="checked"</#if> /><label for="topic_type2">${I18n.getMessage("PostForm.setTopicAsAnnounce")}</label>&nbsp;&nbsp;
									</span>
								</td>
							</tr>
							<#elseif topic?exists>
								<input type="hidden" name="topic_type" value="${topic.type}" />
							</#if>
						</table>
					</td>
				</tr>
				
				<#if setType?default(true) && canCreatePolls?default(false)>
					<#if poll?exists>
						<#assign pollQuestion = poll.label/>
						<#assign pollLength = poll.length/>
					<#else>
						<#assign pollQuestion = ""/>
						<#assign pollLength = "0"/>
					</#if>
					<tr>
						<th class="thhead" colspan="2">${I18n.getMessage("PostForm.addPoll")}</th>
					</tr>
					<tr>
						<td align="center"><span class="gen"><b>${I18n.getMessage("PostForm.pollQuestion")}</b></span></td>
						<td><span class="gen"><input type="text" name="poll_label" maxlength="255" size="50" value="${pollQuestion}"></input></span></td>
					</tr>
					<tr id="pollOptionWithDelete" style="display: none;">
						<td align="center"><span class="gen"><b>${I18n.getMessage("PostForm.pollOption")}</b></span></td>
						<td><span class="gen"><input type="text" id="pollOption" name="poll_option" maxlength="255" size="50"></input></span>
							 <input type="button" onclick="javascript:deletePollOption(this)" value="${I18n.getMessage("PostForm.pollDeleteOption")}"></input></td>
					</tr>
					<#if poll?exists>
						<#assign optionCount = 0/>
						<#list poll.options as option>
							<tr id="pollOption">
								<td align="center"><span class="gen"><b>${I18n.getMessage("PostForm.pollOption")}</b></span></td>
								<td>
									<input type="text" id="pollOption${option.id}" name="poll_option_${option.id}" maxlength="255" size="50" value="${option.text}"></input>
									<input type="button" onclick="javascript:deletePollOption(this)" value="${I18n.getMessage("PostForm.pollDeleteOption")}"></input>
								</td>
							</tr>

							<#if (option.id > optionCount)><#assign optionCount = option.id/></#if>
						</#list>

						<input type="hidden" name="poll_option_count" id="pollOptionCount" value="${optionCount}"/>
					<#else>
						<input type="hidden" name="poll_option_count" id="pollOptionCount" value="1"/>
						<tr id="pollOption">
							<td align="center"><span class="gen"><b>${I18n.getMessage("PostForm.pollOption")}</b></span></td>
							<td>
								 <input type="text" id="pollOption1" name="poll_option_1" maxlength="255" size="50"></input>
								 <input type="button" onclick="javascript:deletePollOption(this)" value="${I18n.getMessage("PostForm.pollDeleteOption")}"></input>								 
							</td>
						</tr>
					</#if>
					<tr id="pollOptionWithAdd">
						<td align="center">
							<span class="gen"><b>${I18n.getMessage("PostForm.pollAddOption")}</b></span>
						</td>
						<td>
							<input type="button" onclick="javascript:addPollOption()" value="${I18n.getMessage("PostForm.pollAddOption")}"></input>
						</td>
					</tr>
					<tr>
						<td align="center"><span class="gen"><b>${I18n.getMessage("PostForm.pollRunFor")}</b></span></td>
						<td><span class="gen"><input type="text" name="poll_length" maxlength="5" size="4" value="${pollLength}"></input> <b>${I18n.getMessage("PostForm.pollDays")}</b></span> 
							<span class="gensmall">${I18n.getMessage("PostForm.pollDaysDescription")}</span></td>
					</tr>
				</#if>

				<#if needCaptcha?default(false)>
					<tr>
						<td class="row1" valign="middle"><span class="gen"><b>${I18n.getMessage("User.captchaResponse")}:</b></span></td>
						<td class="row2">
							<input class="post" style="WIDTH: 100px; font-weight: bold;" maxlength="25" size="25" name="captcha_anwser" /> 
							<img src="${JForumContext.encodeURL("/captcha/generate/${timestamp}")}" border="0" align="middle" alt="Captcha unavailable" />
						</td>
					</tr>
				</#if>

				<#if error?exists>
					<tr>
						<td class="row1">&nbsp;</td>
						<td class="row2"><span class="gen"><font color="red"><b>${error}</b></font></span></td>
					</tr>
				</#if>
				
				<tr align="center">
					<td height="28" colspan="2" class="catbottom">              
						<input class="mainoption" tabindex="5" type="button" value="${I18n.getMessage("PostForm.preview")}" onclick="previewMessage();" />&nbsp;
						<input class="mainoption" accesskey="s" tabindex="6" type="submit" value="${I18n.getMessage("PostForm.submit")}" name="post" />
						<#if attachmentsEnabled>
							<input class="mainoption" accesskey="s" tabindex="7" type="button" onclick="openAttachmentPanel();" value="${I18n.getMessage("Attachments.attach")}" name="post" />
						</#if>
					</td>
				</tr>
			</table>
		</td>
	</tr>

	<#if attachmentsEnabled || attachments?exists>
	<tr>
	<td colspan="2" id="tdAttachPanel" align="center" style="display: <#if attachmentsEnabled>none;<#elseif attachments?exists>'';</#if>">
	<input type="hidden" name="edit_attach_ids" />
	<input type="hidden" name="delete_attach" />
	<input type="hidden" name="total_files" id="total_files" />

		<table border="0" cellpadding="3" cellspacing="0" width="70%" class="forumline" id="tblAttachments">
			<tr>
				<td class="cathead" height="28" colspan="3" align="center"><b><span class="cattitle">${I18n.getMessage("Attachments.panel")}</span></b></td>
			</tr>
			<tr>
				<td align="center">
					<span class="gensmall">
					<b>${I18n.getMessage("Attachments.maxToAttach")}:</b> <font color="red">${maxAttachments}</font> 
					<#assign maxSize = maxAttachmentsSize / 1024>
					<#if (maxSize > 1)>
						/ 
						<b>${I18n.getMessage("Attachments.maxSize")}:</b> <font color="red">${maxSize} kb</font>
					</#if>
					</span>
				</td>
			</tr>
			<tr>
				<td align="center">
					<div id="edit_attach"></div>

					<!-- Attachments -->
				   <div id="attach_0"></div>
				   
				</td>
			</tr>
			<#if attachmentsEnabled>
			<tr>
				<td align="center" class="row3"><input type="button" name="add_attach" value="${I18n.getMessage("PostForm.AddAnotherFile")}" class="mainoption" onclick="addAttachmentFields()" /></td>
			</tr>
			</#if>
		</table>
	</td>
	</tr>
	</#if>

	<#if ((topic?exists && topic.id > 0) || pmReply?default(false))>
	<tr>
	<td colspan="2">
		<table border="0" cellpadding="3" cellspacing="0" width="100%" class="forumline">
			<tr>
				<th class="cathead" height="28" align="center"><b><span class="cattitle">${I18n.getMessage("PostShow.topicReview")}</span></b></th>
			</tr>
	
			<tr>
				<td class="row1">
					<#if pmReply?default(false)>
						<iframe width="100%" height="300" frameborder="0" src="${JForumContext.encodeURL("/jforum${extension}?module=pm&amp;action=review&amp;id=${pm.id}", "")}" ></iframe>
					<#else>
						<iframe width="100%" height="300" frameborder="0" src="${JForumContext.encodeURL("/posts/review/${start}/${topic.id}")}" ></iframe>
					</#if>
				</td>
			</tr>
			
		</table>
	</td>
	</tr>
	</#if>
</table>

<script type="text/javascript">
<!--
<#include "js/attachments.js"/>

<#if attachments?exists>
	ignoreStart = true;
	<#if attachmentsEnabled>
		openAttachmentPanel();
	</#if>
	editAttachments();
</#if>

<#if preview>document.location = "#preview";</#if>
-->
</script>

</form>

<#include "bottom.htm"/>